<template>
	<el-table-column v-bind="$attrs" :min-width="minWidth" show-overflow-tooltip>
		<template #default="{ row }">
			<el-input v-model="row[prop]" :disabled="!isEdit" />
		</template>
	</el-table-column>
</template>
<script lang="ts" setup>
// 正常的列, 非定制化的 ,主要是为了统一默认列宽120
defineOptions({
	name: 'MkColumnInput',
});

const props = defineProps({
	prop: {
		type: String,
		required: true,
	},
	isEdit: {
		type: Boolean,
		default: false,
	},
	autoWidth: {
		type: Boolean,
	},
	minWidth: {
		type: [String, Number],
		default: 120,
	},
});
</script>
<style lang="scss" scoped>
:deep(tbody .el-table__row) {
	.el-table__cell {
		text-align: center;
		padding: 0;
	}


	.cell {
		padding: 0;
		width: auto !important;
	}

	.el-table-column--selection .cell {
		padding: 0 40%;
	}

	.el-input {
		width: 100% !important;
	}
}
</style>